<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateManagerTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('manager', function (Blueprint $table) {
            $table->increments('id');
            $table->string('username',20)->notNull();
            //20的varchar，不为空
            $table->string('password')->notNull();

            $table->enum('gender',[1,2,3])->notNull()->default('1');
            //性别，1男2女3保密 枚举型
            $table->string('mobile',11);
            $table->string('email',50);
            $table->tinyInteger('role_id');
            $table->timestamps();
            $table->rememberToken();
            //实现记住登陆状态字段，用于存储token
            $table->enum('status',[1,2])->notNull()->default('2');
            //账号状态，1禁用2启用
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('manager');
    }
}
